//
//  TMAccountPayView.m
//  国学培训用户端
//
//  Created by Tao Li on 2018/7/9.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "TMAccountPayView.h"

@implementation TMAccountPayView
- (IBAction)goToPayAction:(UIButton *)sender {
     //[self removeFromSuperview];
    if (self.block) {
        self.block(self.code);
    }
}
- (IBAction)hasChooseBtnAction:(UIButton *)sender {
    sender.selected = !sender.selected;
    for (int i= 0 ;i < self.chooseBtnCollections.count ; i++) {
        if (sender.tag == 10 + i ) {
            sender.selected = YES;
            self.code = sender.tag-9;
            continue;
        }
        UIButton *btn = [self viewWithTag:10 + i];
        btn.selected = NO;
    }
    
    
}
- (void)awakeFromNib{
    [super awakeFromNib];
    self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    UITouch *touch = [touches anyObject];
    CGPoint location = [touch locationInView:self];
    if (location.y > kWindowH-320) {
        
    }else{
        [self removeFromSuperview];
    }

}
@end
